<!--
 * @Date: 2021-10-18 16:42:12
 * @LastEditors: 邓春宜
 * @Desc: 
 * @LastEditTime: 2022-01-09 15:57:15
 * @FilePath: \web-ems\src\component\board\MoveTable.vue
--> 
<template>
  <div>
    <MoveTableCommon
      v-bind="$props"
      v-if="reFresh"
    ></MoveTableCommon>
    <!-- <MoveTableCommon
      :width="width"
      :margin="margin"
      :th="th"
      :td="td"
      :tdwidth="tdwidth"
      :trheight="trheight"
      :tableheight="tableheight"
      :speed="speed"
      v-if="reFresh"
    ></MoveTableCommon> -->
  </div>
</template>

<script>
import MoveTableCommon from "@/component/board/common/MoveTableCommon.vue";
import { nextTick, toRefs, ref, reactive, watch, computed } from "vue";
export default {
  components: {
    MoveTableCommon,
  },
  props: {
    width: {
      type: String,
      default: "100%",
    }, 
    margin: {
      type: Number,
      default: 5,
    },
    speed: {
      type: Number,
      default: 50,
    },
    tableheight: {
      type: Number,
      default: 500,
    },
    trheight: {
      type: Number,
      default: 40,
    },
    tdwidth: {
      type: Array,
      default: [],
    },
    th: {
      type: Array,
    },
    td: {
      type: Array,
      default: [],
    },
    fontSize: {
      type: String,
      default: "20px",
    },
  },
  setup(props) {
    const state = reactive({
      reFresh: true,
    });
    const reload = async () => {
      state.reFresh = false;
      await nextTick();
      state.reFresh = true
    };
    /*监听props*/
    watch(props, (newProps, oldProps) => {
      //console.log(11111);
      reload();
    });

    return {
      ...toRefs(state),
    };
  },
};
</script>

<style scoped>
</style>